local key = KEYS[1]
local unfollowUserId = ARGV[1]

--先判断是否存在
local exists = redis.call('EXISTS', key)
if exists == 0 then
    return -1
end

-- 判断是否关注了
local score = redis.call('ZSCORE', key, unfollowUserId)
if score == false or score == nil then
    return -2
end

-- 取消关注
redis.call('ZREM', key, unfollowUserId)
return 0